package dbobjects;

import dbreflection.tablemanagement.DOExternalObject;
import dbreflection.tablemanagement.DOField;
import dbreflection.tablemanagement.DOTable;
import dbreflection.tablemanagement.DatabaseObject;

/**
 * Created by IntelliJ IDEA.
 * User: [J0k3r]
 * Date: 15.11.2008
 * Time: 1:45:12
 */
@DOTable(table = "object_param", pk = "id")
public class ObjectParam extends DatabaseObject {
    @DOField(column = "id")
    private Integer id;
    @DOField(column = "name")
    private String name;
    @DOField(column = "type")
    private Integer type;
    @DOExternalObject(table = "object_param_type", linkedBy = "type", linkedTo = "id")
    private ObjectParamType objectParamType;
    @DOField(column = "foreign_table")
    private String foreignTable;
    @DOField(column = "foreign_field")
    private String foreignField;
    @DOField(column = "notnull")
    private Integer notNull;

    public ObjectParam() {
        this.id = UNASSIGNEDINT;
        this.name = UNASSIGNEDSTRING;
        this.type = UNASSIGNEDINT;
        this.foreignTable = UNASSIGNEDSTRING;
        this.foreignField = UNASSIGNEDSTRING;
        this.notNull = UNASSIGNEDINT;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public ObjectParamType getObjectParamType() {
        return objectParamType;
    }

    public void setObjectParamType(ObjectParamType objectParamType) {
        this.objectParamType = objectParamType;
    }

    public String getForeignTable() {
        return foreignTable;
    }

    public void setForeignTable(String foreignTable) {
        this.foreignTable = foreignTable;
    }

    public String getForeignField() {
        return foreignField;
    }

    public void setForeignField(String foreignField) {
        this.foreignField = foreignField;
    }

    public Integer getNotNull() {
        return notNull;
    }

    public void setNotNull(Integer notNull) {
        this.notNull = notNull;
    }
}
